<!--  -->
<template>
    <div>
<footer th:fragment="footer" class="ui inverted vertical segment m-pad-tb-big m-opacity">
    <div class="ui container center aligned ">
        <p class="m-text-thin m-text-spaced-large m-opacity-mini m-margin-bottom-mini">本站已运行：{{time}}</p>
        <p class="m-text-thin m-text-spaced-large m-opacity-mini m-margin-bottom-mini">备案号</p>
        
    </div>
</footer>

    </div>
</template>

<script>
export default {
    data () {
        return {
            time:""
        };
    },
    methods:{
        countTime(){
            var createTime = new Date("2021-02-07 12:00")
            var nowTime = Date.parse(new Date())
            var second = (nowTime-createTime)/1000
            var Time =""
            Time = Time+ parseInt(second / (24 * 3600))+"天";
            if (second >= 24 * 3600) {
                second %= (24 * 3600);
            }
            Time = Time+ parseInt(second / 3600)+"时";
            if (second >= 3600) {
                second %= 3600;
            }
            Time = Time+ parseInt(second / 60)+"分";
            if (second >= 60) {
                second %= (60);
            }
            Time = Time+second+"秒";
            this.time = Time
        }
    },

    mounted(){
        //初始运行时间
        setInterval(this.countTime,1000);
    }
}

</script>
<style lang='scss' scoped>
</style>